/**
 * 首页样式 - 中华传统文化风格
 */

* {
  font-family: 'STKaiti', 'KaiTi', serif;
}

.home-container {
  min-height: 100vh;
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
  background: linear-gradient(180deg, #F5F0E8 0%, #FAF8F3 100%);
  position: relative;
  box-sizing: border-box;
}

/* 头部区域 */
.home-header {
  position: relative;
  width: 100%;
  min-height: 24vh;
  max-height: 240px;
  overflow: visible;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-top: 50px;
  padding-bottom: 25px;
  box-sizing: border-box;
}

.header-bg {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 100%;
  background: 
    url('../../assets/images/background.jpg') center center / cover no-repeat;
  
  &::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(180deg, rgba(245, 240, 232, 0.2) 0%, rgba(250, 248, 243, 0.25) 50%, rgba(255, 252, 245, 0.3) 100%);
    pointer-events: none;
  }
  
  &::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background-image: 
      repeating-linear-gradient(45deg, transparent, transparent 35px, rgba(255,255,255,.03) 35px, rgba(255,255,255,.03) 70px);
    animation: patternMove 20s linear infinite;
    pointer-events: none;
  }
}

@keyframes patternMove {
  0% {
    transform: translate(0, 0);
  }
  100% {
    transform: translate(70px, 70px);
  }
}

.header-content {
  position: relative;
  z-index: 2;
  width: 100%;
  padding: 0 40px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
  animation: fadeInUp 0.8s cubic-bezier(0.4, 0, 0.2, 1);
  box-sizing: border-box;
}

.header-title {
  font-size: clamp(32px, 8vw, 64px);
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.15em;
  text-shadow: 0 4px 8px rgba(0,0,0,0.2);
  font-family: 'STKaiti', 'KaiTi', serif;
  line-height: 1.2;
}

.header-subtitle {
  font-size: clamp(14px, 3.5vw, 28px);
  color: rgba(255,255,255,0.9);
  letter-spacing: 0.2em;
  font-family: 'STKaiti', 'KaiTi', serif;
}


/* 主体区域 */
.home-body {
  position: relative;
  z-index: 3;
  width: 100%;
  padding: 35px 20px 80px;
  margin-top: -25px;
  background: linear-gradient(180deg, #FAF8F3 0%, #FAF8F3 100%);
  border-radius: 32px 32px 0 0;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.05);
  box-sizing: border-box;
}

.section-header {
  margin-bottom: 30px;
  margin-top: 5px;
}

.section-title-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
}

.section-decoration {
  width: 60px;
  height: 2px;
  background: linear-gradient(90deg, transparent 0%, #8C6E4B 100%);
  flex-shrink: 0;
  align-self: center;
  
  &:last-child {
    background: linear-gradient(90deg, #8C6E4B 0%, transparent 100%);
  }
}

.section-title {
  font-size: clamp(24px, 5vw, 36px);
  font-weight: 600;
  color: #6B5438;
  letter-spacing: 0.15em;
  font-family: 'STKaiti', 'KaiTi', serif;
  line-height: 1;
  white-space: nowrap;
  padding: 0;
  margin: 0;
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.5);
}

/* 主题网格 */
.themes-scroll {
  width: 100%;
}

.themes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr));
  gap: clamp(16px, 3vw, 30px);
  padding-bottom: 40px;
  width: 100%;
}

.theme-card {
  position: relative;
  background: rgba(255, 252, 245, 0.95);
  backdrop-filter: saturate(150%) blur(15px);
  -webkit-backdrop-filter: saturate(150%) blur(15px);
  border-radius: clamp(12px, 2vw, 20px);
  padding: clamp(30px, 5vw, 40px) clamp(15px, 3vw, 20px) clamp(20px, 4vw, 30px);
  box-shadow: 0 6px 20px rgba(107, 84, 56, 0.12), 0 2px 6px rgba(140, 110, 75, 0.08);
  overflow: hidden;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1),
              box-shadow 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  min-height: 280px;
  animation: fadeInUp 0.6s cubic-bezier(0.4, 0, 0.2, 1) backwards;
  border: none;
  
  &:nth-child(1) { animation-delay: 150ms; }
  &:nth-child(2) { animation-delay: 250ms; }
  &:nth-child(3) { animation-delay: 350ms; }
  &:nth-child(4) { animation-delay: 450ms; }
  
  &:active {
    transform: scale(0.96) translateY(2px);
    box-shadow: 0 3px 10px rgba(107, 84, 56, 0.15);
  }
}

.theme-card-bg {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 80px;
  z-index: 1;
}

.theme-card-border {
  display: none;
}

.theme-icon-wrapper {
  position: relative;
  z-index: 2;
  text-align: center;
  margin-bottom: 20px;
}

.theme-icon {
  font-size: clamp(48px, 10vw, 72px);
  line-height: 1;
}

.theme-info {
  position: relative;
  z-index: 2;
  text-align: center;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.theme-name {
  display: block;
  font-size: clamp(18px, 4vw, 32px);
  font-weight: 600;
  color: #333;
  margin-bottom: 10px;
  letter-spacing: 0.1em;
  font-family: 'STKaiti', 'KaiTi', serif;
  line-height: 1.3;
}

.theme-description {
  display: block;
  font-size: clamp(12px, 3vw, 24px);
  color: #666;
  line-height: 1.6;
  margin-bottom: 15px;
  padding: 0 5px;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.theme-count {
  display: flex;
  align-items: baseline;
  justify-content: center;
  padding-top: 12px;
  border-top: 1px solid rgba(140, 110, 75, 0.15);
  margin-top: auto;
}

.count-number {
  font-size: clamp(24px, 5vw, 36px);
  font-weight: 700;
  color: #8C6E4B;
}

.count-text {
  font-size: clamp(14px, 3vw, 24px);
  color: #999;
  margin-left: 4px;
}

/* 加载状态 */
.loading-wrapper {
  text-align: center;
  padding: 100px 0;
}

.loading-text {
  font-size: 28px;
  color: #999;
}

.empty-wrapper {
  text-align: center;
  padding: 100px 0;
}

.empty-text {
  font-size: 28px;
  color: #666;
}

/* 底部装饰 */
.home-footer {
  display: none;
}

/* 响应式适配 */
@media (max-width: 600px) {
  .home-header {
    min-height: 22vh;
    max-height: 220px;
  }
  
  .themes-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  
  .theme-card {
    min-height: 240px;
  }
}

@media (min-width: 1200px) {
  .themes-grid {
    grid-template-columns: repeat(4, 1fr);
    max-width: 1400px;
    margin: 0 auto;
  }
  
  .home-body {
    padding: 35px 40px 80px;
  }
}

@media (min-width: 900px) and (max-width: 1199px) {
  .themes-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 600px) and (max-width: 899px) {
  .themes-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
